package cn.cvs.service.impl;

import cn.cvs.dao.StorageRecordDao;
import cn.cvs.pojo.StorageRecord;
import cn.cvs.service.StorageRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StorageRecordServiceImpl implements StorageRecordService {

    @Autowired
    private StorageRecordDao storageRecordDao;


    @Override
    public List<StorageRecord> findStorageRecord(String queryGoodsName, Integer querySupplierId, Integer queryPayStatus, Integer pageIndex, Integer pageSize) {
        return storageRecordDao.findStorageRecord(queryGoodsName,querySupplierId,queryPayStatus,(pageIndex -1) * pageSize ,pageSize);
    }

    @Override
    public Integer getUserCount(String queryGoodsName, Integer querySupplierId, Integer queryPayStatus) {
        return storageRecordDao.getUserCount(queryGoodsName,querySupplierId,queryPayStatus);
    }

    @Override
    public StorageRecord getByIdOrStorageRecord(Integer id) {
        return storageRecordDao.getByIdOrStorageRecord(id);
    }

    @Override
    public int delStorageRecord(Integer id) {
        return storageRecordDao.delStorageRecord(id);
    }

    @Override
    public int addStorageRecord(StorageRecord storageRecord) {
        return storageRecordDao.addStorageRecord(storageRecord);

    }

    @Override
    public int updateStorageRecord(StorageRecord storageRecord) {
        return storageRecordDao.updateStorageRecord(storageRecord);
    }
}
